package com.whmskj.xjlhsc.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whmskj.xjlhsc.mapper.BacktoyourfeetandweighMapper;
import com.whmskj.xjlhsc.entity.Backtoyourfeetandweigh;
import com.whmskj.xjlhsc.service.BacktoyourfeetandweighService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.List;

/**
 * @author lk
 * @since 2025-07-16 08:36:20
 */
@Service
@Slf4j
public class BacktoyourfeetandweighServiceImpl extends ServiceImpl<BacktoyourfeetandweighMapper, Backtoyourfeetandweigh> implements BacktoyourfeetandweighService {

    @Autowired
    private BacktoyourfeetandweighMapper backtoyourfeetandweighMapper;

    @Override
    public Page<Backtoyourfeetandweigh> findPage(Backtoyourfeetandweigh params) {
        Page<Backtoyourfeetandweigh> page = new Page<>(1, 10);//TODO 自行处理
        LambdaQueryWrapper<Backtoyourfeetandweigh> query = Wrappers.lambdaQuery(Backtoyourfeetandweigh.class);
        return backtoyourfeetandweighMapper.selectPage(page, query);
    }

    @Override
    public List<Backtoyourfeetandweigh> findList(Backtoyourfeetandweigh params){
        LambdaQueryWrapper<Backtoyourfeetandweigh> query = Wrappers.lambdaQuery(Backtoyourfeetandweigh.class);

        return backtoyourfeetandweighMapper.selectList(query);
    }

    @Override
    public Backtoyourfeetandweigh findById(Long id) {
        return backtoyourfeetandweighMapper.selectById(id);
    }

    @Override
    public boolean insert(Backtoyourfeetandweigh backtoyourfeetandweigh) {
        return save(backtoyourfeetandweigh);
    }

    @Override
    public boolean update(Backtoyourfeetandweigh backtoyourfeetandweigh) {
        return updateById(backtoyourfeetandweigh);
    }

    @Override
    public int delete(Long id) {
        return backtoyourfeetandweighMapper.deleteById(id);
    }

}